<template>
	<view class="main">
		<button @click="show">展示</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				subNvue: null
			};
		},
		mounted() {
			uni.$on('heheToIndex', (res) => {  
			    console.log(res)
				this.hide()
			}) 
			this.initAction()
		},
		methods: {
			initAction() {
				this.subNvue = uni.getSubNVueById('heheSub')
			},
			show() {
				this.subNvue.show()
			},
			hide() {
				this.subNvue.hide()
			}
		}
	}
	
</script>

<style>
	.main {
		padding: 100rpx;
		background-color: beige;
	}
</style>